package com.woniu.p2p.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.woniu.p2p.excelservice.InChargeService;
import com.woniu.p2p.vo.ImportCharge;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author 86152
 * @create 2020/8/15
 * @since 1.0.0
 */
@Component
public class InChargeListener extends AnalysisEventListener<ImportCharge> {

    @Autowired
    InChargeService inChargeService;

    @Override
    public void invoke(ImportCharge importCharge, AnalysisContext analysisContext) {
        System.out.println(importCharge);
        inChargeService.readExcel(importCharge);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
